package com.luckdraw.domain;

import java.util.Date;

import org.nutz.dao.entity.annotation.ColDefine;
import org.nutz.dao.entity.annotation.ColType;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.Table;
import org.nutz.lang.Strings;
import org.nutz.repo.Base64;

/**
 * 佣金获取记录
 * @ClassName: CommissionLog 
 * @author gaotaochen
 * @Description: 
 * @date 2017年1月17日 上午11:00:04 
 *
 */
@Table("LuckDraw_CommissionLog")
public class CommissionLog {
	
	/**
	 * ID
	 */
	@Id
//	oracle数据库时使用
//	@Id(auto=false)
//	@Prev(@SQL(value="select LuckDraw_CommissionLog_SEQ.Nextval from dual",db=DB.ORACLE))
	@ColDefine(width=10,precision=0)
	private int id;
	
	/**
	 * 用户ID
	 */
	@Column("user_id")
	@ColDefine(type=ColType.VARCHAR,notNull=true,width=36)
	private String userId;
	
	/**
	 * 下级用户ID
	 */
	@Column("sub_user_id")
	@ColDefine(type=ColType.VARCHAR,notNull=true,width=36)
	private String subUserId;
	
	/**
	 * 下级用户昵称
	 */
	@Column("sub_nick_name")
	@ColDefine(type=ColType.VARCHAR,width=64)
	private String subNickName;
	
	/**
	 * 支付订单ID
	 */
	@Column("order_id")
	@ColDefine(type=ColType.VARCHAR,notNull=true,width=32)
	private String orderId;
	
	/**
	 * 支付金额
	 */
	@Column("pay_amount")
	@ColDefine(width=10,precision=0)
	private int payAmount;
	
	/**
	 * 佣金金额
	 */
	@Column("commission")
	@ColDefine(width=10,precision=0)
	private int commission;
	
	/**
	 * 获得时间
	 */
	@Column("pay_time")
	private Date payTime;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getSubUserId() {
		return subUserId;
	}

	public void setSubUserId(String subUserId) {
		this.subUserId = subUserId;
	}

	public String getSubNickName() {
		return subNickName;
	}

	public String getSubNickName2() {
		if(Strings.isNotBlank(this.subNickName)){
			return new String(Base64.decode(subNickName));
		}else{
			return this.subNickName;
		}
	}

	public void setSubNickName(String subNickName) {
		this.subNickName = subNickName;
	}

	public int getPayAmount() {
		return payAmount;
	}

	public void setPayAmount(int payAmount) {
		this.payAmount = payAmount;
	}

	public int getCommission() {
		return commission;
	}

	public void setCommission(int commission) {
		this.commission = commission;
	}

	public Date getPayTime() {
		return payTime;
	}

	public void setPayTime(Date payTime) {
		this.payTime = payTime;
	}

	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}
	
}